package com.hunter.jerrymouse.annotation.request;


import java.lang.annotation.*;

/**
 * Created by hunter
 * <p>
 * 请求注解
 */
@Target({ElementType.TYPE, ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface RequestRouter {

    /**
     * 请求路径
     *
     * @return
     */
    String path() default "/";

    /**
     * 支持的请求方法
     *
     * @return
     */
    Method[] method() default {};


    /**
     * 请求方法枚举
     */
    enum Method {

        GET("GET"),
        HEAD("HEAD"),
        POST("POST"),
        PUT("PUT"),
        PATCH("PATCH"),
        DELETE("DELETE"),
        OPTIONS("OPTIONS"),
        TRACE("TRACE");

        private String name;

        Method(String name) {
            this.name = name;
        }

        public String getName() {
            return name;
        }
    }
}
